package com.android.clinic.doctors.app.http;

import com.android.clinic.doctors.app.entity.InquiryInfo;
import com.android.clinic.doctors.app.entity.PatientInfo;
import com.android.clinic.doctors.app.entity.ReplyPatientInfo;
import com.android.clinic.doctors.app.entity.UserInfo;
import com.android.clinic.doctors.app.http.base.BaseResponse;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * Created by cheng on 2018/6/19.
 */
public interface HttpService {

    /**
     * 登录
     * @param json
     * @return
     */
    @Headers("Content-Type: application/json")
    @POST("doctor/to_login")
    Observable<BaseResponse<UserInfo>> login(@Body RequestBody json);

    /**
     * 修改登录密码
     * @param json
     * @return
     */
    @Headers("Content-Type: application/json")
    @POST("doctor/to_update_password")
    Observable<BaseResponse<String>> updatePassword(@Body RequestBody json);

    /**
     * 查询医生公告
     * @param doctorId
     * @return
     */
    @GET("doctor/to_find_notice/{doctorId}")
    Observable<BaseResponse<UserInfo>> findNotice(@Path("doctorId") String doctorId);

    /**
     * 更新医生公告
     * @param json
     * @return
     */
    @Headers("Content-Type: application/json")
    @POST("doctor/to_update_notice")
    Observable<BaseResponse<String>> updateNotice(@Body RequestBody json);


    /**
     * 我的患者
     * @param doctorId
     * @return
     */
    @POST("doctor/follow_list/{doctorId}")
    Observable<BaseResponse<List<PatientInfo>>> getFollowList(@Path("doctorId") String doctorId);

    /**
     * 医生所有未完成的记录(对应患者的已预约)
     * @param doctorId
     * @return
     */
    @GET("video/doctor/list_un_completed/{doctorId}")
    Observable<BaseResponse<List<PatientInfo>>> getListUnCompleted(@Path("doctorId") String doctorId);

    /**
     * 医生所有已处理的记录(对应患者的已处理)
     * @param doctorId
     * @return
     */
    @GET("video/doctor/list_ed/{doctorId}")
    Observable<BaseResponse<List<PatientInfo>>> getListEd(@Path("doctorId") String doctorId);

    /**
     * 医生变更状态为已处理
     * @param id
     * @return
     */
    @POST("video/doctor/resolved/{id}")
    Observable<BaseResponse<String>> postResolved(@Path("id") String id);

    /**
     * 查询医生所有的图文问诊列表
     * @param doctorId
     * @return
     */
    @GET("doctor/list_all_inquire/{doctorId}")
    Observable<BaseResponse<List<InquiryInfo>>> getListAllInquiry(@Path("doctorId") String doctorId);

    /**
     * 医生回复问诊
     * @param json
     * @return
     */
    @Headers("Content-Type: application/json")
    @POST("doctor/to_answer_inquire")
    Observable<BaseResponse<String>> answerInquiry(@Body RequestBody json);

    /**
     * 结束问诊
     * @param inquireId
     * @return
     */
    @POST("doctor/to_close_inquire/{inquireId}/{noticeId}")
    Observable<BaseResponse<String>> closeInquire(@Path("inquireId") String inquireId, @Path("noticeId") String noticeId);

    /**
     * 医生联系患者
     * @param json
     * @return
     */
    @Headers("Content-Type: application/json")
    @POST("connect/doctor/to_add_one")
    Observable<BaseResponse<ReplyPatientInfo>> doctorContactPatient(@Body RequestBody json);

    /**
     * 版本更新
     * @return
     */
    @GET("http://47.97.17.240:8080/Agreement/versionDoctor.json")
    Call<ResponseBody> getVersion();

}
